package com.dongdongshop.dataConfig;

public class dataResult<T> {
    public static Integer code;//响应码

    public static String message;//响应数据

    private T data;

    public static dataResult response(ResponseStatus responseStatus){
        return new dataResult(responseStatus.getIndex(),responseStatus.getName());
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public dataResult setData(T data) {
        this.data = data;
        return this;
    }

    public dataResult(Integer code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public dataResult(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
